{% if kube_version.split('.')[0] == '1' and kube_version.split('.')[1] == '14' %}
apiVersion: kubeadm.k8s.io/v1beta1
{% else %}
apiVersion: kubeadm.k8s.io/v1beta2
{% endif %}
bootstrapTokens:
- groups:
  - system:bootstrappers:kubeadm:default-node-token
  token: abcdef.0123456789abcdef
  ttl: 2h0m0s
  usages:
  - signing
  - authentication
kind: InitConfiguration
localAPIEndpoint:
  advertiseAddress: {{ ansible_default_ipv4.address }}
  bindPort: {{ kube_port_tcp_arg.api }}
nodeRegistration:
  criSocket: /var/run/dockershim.sock
  name: {{ ansible_fqdn }}
  taints:
  - effect: NoSchedule
    key: node-role.kubernetes.io/master
---
apiServer:
  timeoutForControlPlane: 10m0s
{% if kube_version.split('.')[0] == '1' and kube_version.split('.')[1] == '14' %}
apiVersion: kubeadm.k8s.io/v1beta1
{% else %}
apiVersion: kubeadm.k8s.io/v1beta2
{% endif %}
certificatesDir: /etc/kubernetes/pki
clusterName: kubernetes
controllerManager: {}
dns:
  type: CoreDNS
etcd:
  local:
    dataDir: /var/lib/etcd
imageRepository: {{ kube_registry_mirrors['google'] }}/google_containers
kind: ClusterConfiguration
kubernetesVersion: v{{ kube_version }}
controlPlaneEndpoint: "{% if kube_control_plane_endpoint is defined %}{{ kube_control_plane_endpoint | lower }}{% else %}{{ ansible_default_ipv4.address }}:{{ kube_port_tcp_arg.api }}{% endif %}:{{ kube_control_plane_port | default('6443') }}"
networking:
  dnsDomain: cluster.local
  podSubnet: "{{ kube_pod_cidr }}"
  serviceSubnet: "{{ kube_srv_cidr }}"
scheduler: {}
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
mode: {% if kube_proxy_ipvs | bool | default(false) %}ipvs{% endif %}
